<?php

namespace app\api\model;


use think\Model;
use think\Db;
class Floor extends Model
{
	  public function productlist(){
        return $this->hasMany('FloorList','pid','id');
    }
	public function select(){
		$res = self::all([],'product_list');
		foreach ($res as $key => $value) {

			$p['name'] = $value['name'];
			$p['image_src'] = $value['image_src'];
			$res[$key]['floor_title'] = $p;
			unset($value['id'],$value['name'],$value['image_src']);
			
		}
		 if($res){
            return_json(200,'查询成功',$res);
        }else{
            return_json(400,'查询失败');
        }
	}

}
?>